// test1.cpp : Defines the entry point for the console application.

#include <stdio.h>
#include <tchar.h>
#include<stdint.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include"crc32.h"

char strline[1024],charline[1024],tmp[2];
uint32_t crc_result1,crc_result2;
int _tmain(int argc, _TCHAR* argv[])
{
	while(1)
	{
		gets(strline);
		for(int i=0;i<strlen(strline);i+=2)
		{
			tmp[0]=strline[i];
			tmp[1]=strline[i+1];
			charline[i/2]=atoi(tmp);
		}
		int charlenth=strlen(strline)/2;
		crc_result1=CalculateBlockCRC32(charlenth,(unsigned char *)charline);
		printf("%s",strline);
		printf("%x\n",crc_result1);
		//memcpy((charline+charlenth),(void *)&crc_result1,sizeof(uint32_t));
		//crc_result1=CalculateBlockCRC32(charlenth+sizeof(uint32_t),(unsigned char *)charline);
		//printf("crc32check%x\n",crc_result1);
	}
}
